Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A benchmark for some elementary functions #3984

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Apr 17, 2024

Output:

Run on (48 X 3793 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x24)
  L1 Instruction 32 KiB (x24)
  L2 Unified 512 KiB (x24)
  L3 Unified 32768 KiB (x4)
------------------------------------------------------------------------------------------------------
Benchmark                                                            Time             CPU   Iterations
------------------------------------------------------------------------------------------------------
BM_EvaluateElementaryFunction<Metric::Latency, std::sin>          5.96 ns         6.00 ns    112000000
BM_EvaluateElementaryFunction<Metric::Throughput, std::sin>       4.04 ns         3.99 ns    172308000
BM_EvaluateElementaryFunction<Metric::Latency, std::cos>          6.84 ns         6.84 ns    112000000
BM_EvaluateElementaryFunction<Metric::Throughput, std::cos>       4.25 ns         4.24 ns    165926000

#1760.

using Argument = double;

std::mt19937_64 random(42);
std::uniform_real_distribution<> uniformly_at(-10.0, 10.0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to [-1, 1] for consistency with the latency benchmark.

@eggrobin eggrobin added the LGTM label Apr 17, 2024
@pleroy pleroy merged commit f9a8d2e into mockingbirdnest:master Apr 17, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants